package dreadnought;

/*
 * This exception will be thrown if any coordinates are encountered
 * which are outside the grid.
 * It extends RuntimeException instead of Exception because it is unchecked.
 * This means that methods that throw this exception are not required
 * to have "throws OutOfRangeException" and the exception doesn't propagate.
 * It's kind of bad practice to use unchecked exceptions but we aren't
 * interested in error handling right now, just debugging.
 * We can easily change this to a checked exception later.
 */
public class OutOfRangeException extends RuntimeException
{
    //default contructor with no custom message
    public OutOfRangeException()
    {
        super("A value was out of range. Possibly an invalid coordinate?");
    }

    //overloaded constructor with custom message
    public OutOfRangeException(String msg)
    {
        super(msg);
    }
}
